<!doctype html>

<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>map.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>

<div class="clear"></div>

<h2><a href="local_closure_goog_structs_map.js.html">map.js</a></h2>

<pre class="prettyprint lang-js">
<a name="line1"></a>// Copyright 2006 The Closure Library Authors. All Rights Reserved.
<a name="line2"></a>//
<a name="line3"></a>// Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
<a name="line4"></a>// you may not use this file except in compliance with the License.
<a name="line5"></a>// You may obtain a copy of the License at
<a name="line6"></a>//
<a name="line7"></a>//      http://www.apache.org/licenses/LICENSE-2.0
<a name="line8"></a>//
<a name="line9"></a>// Unless required by applicable law or agreed to in writing, software
<a name="line10"></a>// distributed under the License is distributed on an &quot;AS-IS&quot; BASIS,
<a name="line11"></a>// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<a name="line12"></a>// See the License for the specific language governing permissions and
<a name="line13"></a>// limitations under the License.
<a name="line14"></a>
<a name="line15"></a>/**
<a name="line16"></a> * @fileoverview Datastructure: Hash Map.
<a name="line17"></a> *
<a name="line18"></a> * @author arv@google.com (Erik Arvidsson)
<a name="line19"></a> *
<a name="line20"></a> * This file contains an implementation of a Map structure. It implements a lot
<a name="line21"></a> * of the methods used in goog.structs so those functions work on hashes. This
<a name="line22"></a> * is best suited for complex key types. For simple keys such as numbers and
<a name="line23"></a> * strings, and where special names like __proto__ are not a concern, consider
<a name="line24"></a> * using the lighter-weight utilities in goog.object.
<a name="line25"></a> */
<a name="line26"></a>
<a name="line27"></a>
<a name="line28"></a>goog.provide(&#39;goog.structs.Map&#39;);
<a name="line29"></a>
<a name="line30"></a>goog.require(&#39;goog.iter.Iterator&#39;);
<a name="line31"></a>goog.require(&#39;goog.iter.StopIteration&#39;);
<a name="line32"></a>goog.require(&#39;goog.object&#39;);
<a name="line33"></a>
<a name="line34"></a>
<a name="line35"></a>
<a name="line36"></a>/**
<a name="line37"></a> * Class for Hash Map datastructure.
<a name="line38"></a> * @param {*=} opt_map Map or Object to initialize the map with.
<a name="line39"></a> * @param {...*} var_args If 2 or more arguments are present then they
<a name="line40"></a> *     will be used as key-value pairs.
<a name="line41"></a> * @constructor
<a name="line42"></a> * @template K, V
<a name="line43"></a> */
<a name="line44"></a>goog.structs.Map = function(opt_map, var_args) {
<a name="line45"></a>
<a name="line46"></a>  /**
<a name="line47"></a>   * Underlying JS object used to implement the map.
<a name="line48"></a>   * @private {!Object}
<a name="line49"></a>   */
<a name="line50"></a>  this.map_ = {};
<a name="line51"></a>
<a name="line52"></a>  /**
<a name="line53"></a>   * An array of keys. This is necessary for two reasons:
<a name="line54"></a>   *   1. Iterating the keys using for (var key in this.map_) allocates an
<a name="line55"></a>   *      object for every key in IE which is really bad for IE6 GC perf.
<a name="line56"></a>   *   2. Without a side data structure, we would need to escape all the keys
<a name="line57"></a>   *      as that would be the only way we could tell during iteration if the
<a name="line58"></a>   *      key was an internal key or a property of the object.
<a name="line59"></a>   *
<a name="line60"></a>   * This array can contain deleted keys so it&#39;s necessary to check the map
<a name="line61"></a>   * as well to see if the key is still in the map (this doesn&#39;t require a
<a name="line62"></a>   * memory allocation in IE).
<a name="line63"></a>   * @private {!Array.&lt;string&gt;}
<a name="line64"></a>   */
<a name="line65"></a>  this.keys_ = [];
<a name="line66"></a>
<a name="line67"></a>  /**
<a name="line68"></a>   * The number of key value pairs in the map.
<a name="line69"></a>   * @private {number}
<a name="line70"></a>   */
<a name="line71"></a>  this.count_ = 0;
<a name="line72"></a>
<a name="line73"></a>  /**
<a name="line74"></a>   * Version used to detect changes while iterating.
<a name="line75"></a>   * @private {number}
<a name="line76"></a>   */
<a name="line77"></a>  this.version_ = 0;
<a name="line78"></a>
<a name="line79"></a>  var argLength = arguments.length;
<a name="line80"></a>
<a name="line81"></a>  if (argLength &gt; 1) {
<a name="line82"></a>    if (argLength % 2) {
<a name="line83"></a>      throw Error(&#39;Uneven number of arguments&#39;);
<a name="line84"></a>    }
<a name="line85"></a>    for (var i = 0; i &lt; argLength; i += 2) {
<a name="line86"></a>      this.set(arguments[i], arguments[i + 1]);
<a name="line87"></a>    }
<a name="line88"></a>  } else if (opt_map) {
<a name="line89"></a>    this.addAll(/** @type {Object} */ (opt_map));
<a name="line90"></a>  }
<a name="line91"></a>};
<a name="line92"></a>
<a name="line93"></a>
<a name="line94"></a>/**
<a name="line95"></a> * @return {number} The number of key-value pairs in the map.
<a name="line96"></a> */
<a name="line97"></a>goog.structs.Map.prototype.getCount = function() {
<a name="line98"></a>  return this.count_;
<a name="line99"></a>};
<a name="line100"></a>
<a name="line101"></a>
<a name="line102"></a>/**
<a name="line103"></a> * Returns the values of the map.
<a name="line104"></a> * @return {!Array.&lt;V&gt;} The values in the map.
<a name="line105"></a> */
<a name="line106"></a>goog.structs.Map.prototype.getValues = function() {
<a name="line107"></a>  this.cleanupKeysArray_();
<a name="line108"></a>
<a name="line109"></a>  var rv = [];
<a name="line110"></a>  for (var i = 0; i &lt; this.keys_.length; i++) {
<a name="line111"></a>    var key = this.keys_[i];
<a name="line112"></a>    rv.push(this.map_[key]);
<a name="line113"></a>  }
<a name="line114"></a>  return rv;
<a name="line115"></a>};
<a name="line116"></a>
<a name="line117"></a>
<a name="line118"></a>/**
<a name="line119"></a> * Returns the keys of the map.
<a name="line120"></a> * @return {!Array.&lt;string&gt;} Array of string values.
<a name="line121"></a> */
<a name="line122"></a>goog.structs.Map.prototype.getKeys = function() {
<a name="line123"></a>  this.cleanupKeysArray_();
<a name="line124"></a>  return /** @type {!Array.&lt;string&gt;} */ (this.keys_.concat());
<a name="line125"></a>};
<a name="line126"></a>
<a name="line127"></a>
<a name="line128"></a>/**
<a name="line129"></a> * Whether the map contains the given key.
<a name="line130"></a> * @param {*} key The key to check for.
<a name="line131"></a> * @return {boolean} Whether the map contains the key.
<a name="line132"></a> */
<a name="line133"></a>goog.structs.Map.prototype.containsKey = function(key) {
<a name="line134"></a>  return goog.structs.Map.hasKey_(this.map_, key);
<a name="line135"></a>};
<a name="line136"></a>
<a name="line137"></a>
<a name="line138"></a>/**
<a name="line139"></a> * Whether the map contains the given value. This is O(n).
<a name="line140"></a> * @param {V} val The value to check for.
<a name="line141"></a> * @return {boolean} Whether the map contains the value.
<a name="line142"></a> */
<a name="line143"></a>goog.structs.Map.prototype.containsValue = function(val) {
<a name="line144"></a>  for (var i = 0; i &lt; this.keys_.length; i++) {
<a name="line145"></a>    var key = this.keys_[i];
<a name="line146"></a>    if (goog.structs.Map.hasKey_(this.map_, key) &amp;&amp; this.map_[key] == val) {
<a name="line147"></a>      return true;
<a name="line148"></a>    }
<a name="line149"></a>  }
<a name="line150"></a>  return false;
<a name="line151"></a>};
<a name="line152"></a>
<a name="line153"></a>
<a name="line154"></a>/**
<a name="line155"></a> * Whether this map is equal to the argument map.
<a name="line156"></a> * @param {goog.structs.Map} otherMap The map against which to test equality.
<a name="line157"></a> * @param {function(V, V): boolean=} opt_equalityFn Optional equality function
<a name="line158"></a> *     to test equality of values. If not specified, this will test whether
<a name="line159"></a> *     the values contained in each map are identical objects.
<a name="line160"></a> * @return {boolean} Whether the maps are equal.
<a name="line161"></a> */
<a name="line162"></a>goog.structs.Map.prototype.equals = function(otherMap, opt_equalityFn) {
<a name="line163"></a>  if (this === otherMap) {
<a name="line164"></a>    return true;
<a name="line165"></a>  }
<a name="line166"></a>
<a name="line167"></a>  if (this.count_ != otherMap.getCount()) {
<a name="line168"></a>    return false;
<a name="line169"></a>  }
<a name="line170"></a>
<a name="line171"></a>  var equalityFn = opt_equalityFn || goog.structs.Map.defaultEquals;
<a name="line172"></a>
<a name="line173"></a>  this.cleanupKeysArray_();
<a name="line174"></a>  for (var key, i = 0; key = this.keys_[i]; i++) {
<a name="line175"></a>    if (!equalityFn(this.get(key), otherMap.get(key))) {
<a name="line176"></a>      return false;
<a name="line177"></a>    }
<a name="line178"></a>  }
<a name="line179"></a>
<a name="line180"></a>  return true;
<a name="line181"></a>};
<a name="line182"></a>
<a name="line183"></a>
<a name="line184"></a>/**
<a name="line185"></a> * Default equality test for values.
<a name="line186"></a> * @param {*} a The first value.
<a name="line187"></a> * @param {*} b The second value.
<a name="line188"></a> * @return {boolean} Whether a and b reference the same object.
<a name="line189"></a> */
<a name="line190"></a>goog.structs.Map.defaultEquals = function(a, b) {
<a name="line191"></a>  return a === b;
<a name="line192"></a>};
<a name="line193"></a>
<a name="line194"></a>
<a name="line195"></a>/**
<a name="line196"></a> * @return {boolean} Whether the map is empty.
<a name="line197"></a> */
<a name="line198"></a>goog.structs.Map.prototype.isEmpty = function() {
<a name="line199"></a>  return this.count_ == 0;
<a name="line200"></a>};
<a name="line201"></a>
<a name="line202"></a>
<a name="line203"></a>/**
<a name="line204"></a> * Removes all key-value pairs from the map.
<a name="line205"></a> */
<a name="line206"></a>goog.structs.Map.prototype.clear = function() {
<a name="line207"></a>  this.map_ = {};
<a name="line208"></a>  this.keys_.length = 0;
<a name="line209"></a>  this.count_ = 0;
<a name="line210"></a>  this.version_ = 0;
<a name="line211"></a>};
<a name="line212"></a>
<a name="line213"></a>
<a name="line214"></a>/**
<a name="line215"></a> * Removes a key-value pair based on the key. This is O(logN) amortized due to
<a name="line216"></a> * updating the keys array whenever the count becomes half the size of the keys
<a name="line217"></a> * in the keys array.
<a name="line218"></a> * @param {*} key  The key to remove.
<a name="line219"></a> * @return {boolean} Whether object was removed.
<a name="line220"></a> */
<a name="line221"></a>goog.structs.Map.prototype.remove = function(key) {
<a name="line222"></a>  if (goog.structs.Map.hasKey_(this.map_, key)) {
<a name="line223"></a>    delete this.map_[key];
<a name="line224"></a>    this.count_--;
<a name="line225"></a>    this.version_++;
<a name="line226"></a>
<a name="line227"></a>    // clean up the keys array if the threshhold is hit
<a name="line228"></a>    if (this.keys_.length &gt; 2 * this.count_) {
<a name="line229"></a>      this.cleanupKeysArray_();
<a name="line230"></a>    }
<a name="line231"></a>
<a name="line232"></a>    return true;
<a name="line233"></a>  }
<a name="line234"></a>  return false;
<a name="line235"></a>};
<a name="line236"></a>
<a name="line237"></a>
<a name="line238"></a>/**
<a name="line239"></a> * Cleans up the temp keys array by removing entries that are no longer in the
<a name="line240"></a> * map.
<a name="line241"></a> * @private
<a name="line242"></a> */
<a name="line243"></a>goog.structs.Map.prototype.cleanupKeysArray_ = function() {
<a name="line244"></a>  if (this.count_ != this.keys_.length) {
<a name="line245"></a>    // First remove keys that are no longer in the map.
<a name="line246"></a>    var srcIndex = 0;
<a name="line247"></a>    var destIndex = 0;
<a name="line248"></a>    while (srcIndex &lt; this.keys_.length) {
<a name="line249"></a>      var key = this.keys_[srcIndex];
<a name="line250"></a>      if (goog.structs.Map.hasKey_(this.map_, key)) {
<a name="line251"></a>        this.keys_[destIndex++] = key;
<a name="line252"></a>      }
<a name="line253"></a>      srcIndex++;
<a name="line254"></a>    }
<a name="line255"></a>    this.keys_.length = destIndex;
<a name="line256"></a>  }
<a name="line257"></a>
<a name="line258"></a>  if (this.count_ != this.keys_.length) {
<a name="line259"></a>    // If the count still isn&#39;t correct, that means we have duplicates. This can
<a name="line260"></a>    // happen when the same key is added and removed multiple times. Now we have
<a name="line261"></a>    // to allocate one extra Object to remove the duplicates. This could have
<a name="line262"></a>    // been done in the first pass, but in the common case, we can avoid
<a name="line263"></a>    // allocating an extra object by only doing this when necessary.
<a name="line264"></a>    var seen = {};
<a name="line265"></a>    var srcIndex = 0;
<a name="line266"></a>    var destIndex = 0;
<a name="line267"></a>    while (srcIndex &lt; this.keys_.length) {
<a name="line268"></a>      var key = this.keys_[srcIndex];
<a name="line269"></a>      if (!(goog.structs.Map.hasKey_(seen, key))) {
<a name="line270"></a>        this.keys_[destIndex++] = key;
<a name="line271"></a>        seen[key] = 1;
<a name="line272"></a>      }
<a name="line273"></a>      srcIndex++;
<a name="line274"></a>    }
<a name="line275"></a>    this.keys_.length = destIndex;
<a name="line276"></a>  }
<a name="line277"></a>};
<a name="line278"></a>
<a name="line279"></a>
<a name="line280"></a>/**
<a name="line281"></a> * Returns the value for the given key.  If the key is not found and the default
<a name="line282"></a> * value is not given this will return {@code undefined}.
<a name="line283"></a> * @param {*} key The key to get the value for.
<a name="line284"></a> * @param {DEFAULT=} opt_val The value to return if no item is found for the
<a name="line285"></a> *     given key, defaults to undefined.
<a name="line286"></a> * @return {V|DEFAULT} The value for the given key.
<a name="line287"></a> * @template DEFAULT
<a name="line288"></a> */
<a name="line289"></a>goog.structs.Map.prototype.get = function(key, opt_val) {
<a name="line290"></a>  if (goog.structs.Map.hasKey_(this.map_, key)) {
<a name="line291"></a>    return this.map_[key];
<a name="line292"></a>  }
<a name="line293"></a>  return opt_val;
<a name="line294"></a>};
<a name="line295"></a>
<a name="line296"></a>
<a name="line297"></a>/**
<a name="line298"></a> * Adds a key-value pair to the map.
<a name="line299"></a> * @param {*} key The key.
<a name="line300"></a> * @param {V} value The value to add.
<a name="line301"></a> * @return {*} Some subclasses return a value.
<a name="line302"></a> */
<a name="line303"></a>goog.structs.Map.prototype.set = function(key, value) {
<a name="line304"></a>  if (!(goog.structs.Map.hasKey_(this.map_, key))) {
<a name="line305"></a>    this.count_++;
<a name="line306"></a>    this.keys_.push(key);
<a name="line307"></a>    // Only change the version if we add a new key.
<a name="line308"></a>    this.version_++;
<a name="line309"></a>  }
<a name="line310"></a>  this.map_[key] = value;
<a name="line311"></a>};
<a name="line312"></a>
<a name="line313"></a>
<a name="line314"></a>/**
<a name="line315"></a> * Adds multiple key-value pairs from another goog.structs.Map or Object.
<a name="line316"></a> * @param {Object} map  Object containing the data to add.
<a name="line317"></a> */
<a name="line318"></a>goog.structs.Map.prototype.addAll = function(map) {
<a name="line319"></a>  var keys, values;
<a name="line320"></a>  if (map instanceof goog.structs.Map) {
<a name="line321"></a>    keys = map.getKeys();
<a name="line322"></a>    values = map.getValues();
<a name="line323"></a>  } else {
<a name="line324"></a>    keys = goog.object.getKeys(map);
<a name="line325"></a>    values = goog.object.getValues(map);
<a name="line326"></a>  }
<a name="line327"></a>  // we could use goog.array.forEach here but I don&#39;t want to introduce that
<a name="line328"></a>  // dependency just for this.
<a name="line329"></a>  for (var i = 0; i &lt; keys.length; i++) {
<a name="line330"></a>    this.set(keys[i], values[i]);
<a name="line331"></a>  }
<a name="line332"></a>};
<a name="line333"></a>
<a name="line334"></a>
<a name="line335"></a>/**
<a name="line336"></a> * Calls the given function on each entry in the map.
<a name="line337"></a> * @param {function(this:T, V, K, goog.structs.Map.&lt;K,V&gt;)} f
<a name="line338"></a> * @param {T=} opt_obj The value of &quot;this&quot; inside f.
<a name="line339"></a> * @template T
<a name="line340"></a> */
<a name="line341"></a>goog.structs.Map.prototype.forEach = function(f, opt_obj) {
<a name="line342"></a>  var keys = this.getKeys();
<a name="line343"></a>  for (var i = 0; i &lt; keys.length; i++) {
<a name="line344"></a>    var key = keys[i];
<a name="line345"></a>    var value = this.get(key);
<a name="line346"></a>    f.call(opt_obj, value, key, this);
<a name="line347"></a>  }
<a name="line348"></a>};
<a name="line349"></a>
<a name="line350"></a>
<a name="line351"></a>/**
<a name="line352"></a> * Clones a map and returns a new map.
<a name="line353"></a> * @return {!goog.structs.Map} A new map with the same key-value pairs.
<a name="line354"></a> */
<a name="line355"></a>goog.structs.Map.prototype.clone = function() {
<a name="line356"></a>  return new goog.structs.Map(this);
<a name="line357"></a>};
<a name="line358"></a>
<a name="line359"></a>
<a name="line360"></a>/**
<a name="line361"></a> * Returns a new map in which all the keys and values are interchanged
<a name="line362"></a> * (keys become values and values become keys). If multiple keys map to the
<a name="line363"></a> * same value, the chosen transposed value is implementation-dependent.
<a name="line364"></a> *
<a name="line365"></a> * It acts very similarly to {goog.object.transpose(Object)}.
<a name="line366"></a> *
<a name="line367"></a> * @return {!goog.structs.Map} The transposed map.
<a name="line368"></a> */
<a name="line369"></a>goog.structs.Map.prototype.transpose = function() {
<a name="line370"></a>  var transposed = new goog.structs.Map();
<a name="line371"></a>  for (var i = 0; i &lt; this.keys_.length; i++) {
<a name="line372"></a>    var key = this.keys_[i];
<a name="line373"></a>    var value = this.map_[key];
<a name="line374"></a>    transposed.set(value, key);
<a name="line375"></a>  }
<a name="line376"></a>
<a name="line377"></a>  return transposed;
<a name="line378"></a>};
<a name="line379"></a>
<a name="line380"></a>
<a name="line381"></a>/**
<a name="line382"></a> * @return {!Object} Object representation of the map.
<a name="line383"></a> */
<a name="line384"></a>goog.structs.Map.prototype.toObject = function() {
<a name="line385"></a>  this.cleanupKeysArray_();
<a name="line386"></a>  var obj = {};
<a name="line387"></a>  for (var i = 0; i &lt; this.keys_.length; i++) {
<a name="line388"></a>    var key = this.keys_[i];
<a name="line389"></a>    obj[key] = this.map_[key];
<a name="line390"></a>  }
<a name="line391"></a>  return obj;
<a name="line392"></a>};
<a name="line393"></a>
<a name="line394"></a>
<a name="line395"></a>/**
<a name="line396"></a> * Returns an iterator that iterates over the keys in the map.  Removal of keys
<a name="line397"></a> * while iterating might have undesired side effects.
<a name="line398"></a> * @return {!goog.iter.Iterator} An iterator over the keys in the map.
<a name="line399"></a> */
<a name="line400"></a>goog.structs.Map.prototype.getKeyIterator = function() {
<a name="line401"></a>  return this.__iterator__(true);
<a name="line402"></a>};
<a name="line403"></a>
<a name="line404"></a>
<a name="line405"></a>/**
<a name="line406"></a> * Returns an iterator that iterates over the values in the map.  Removal of
<a name="line407"></a> * keys while iterating might have undesired side effects.
<a name="line408"></a> * @return {!goog.iter.Iterator} An iterator over the values in the map.
<a name="line409"></a> */
<a name="line410"></a>goog.structs.Map.prototype.getValueIterator = function() {
<a name="line411"></a>  return this.__iterator__(false);
<a name="line412"></a>};
<a name="line413"></a>
<a name="line414"></a>
<a name="line415"></a>/**
<a name="line416"></a> * Returns an iterator that iterates over the values or the keys in the map.
<a name="line417"></a> * This throws an exception if the map was mutated since the iterator was
<a name="line418"></a> * created.
<a name="line419"></a> * @param {boolean=} opt_keys True to iterate over the keys. False to iterate
<a name="line420"></a> *     over the values.  The default value is false.
<a name="line421"></a> * @return {!goog.iter.Iterator} An iterator over the values or keys in the map.
<a name="line422"></a> */
<a name="line423"></a>goog.structs.Map.prototype.__iterator__ = function(opt_keys) {
<a name="line424"></a>  // Clean up keys to minimize the risk of iterating over dead keys.
<a name="line425"></a>  this.cleanupKeysArray_();
<a name="line426"></a>
<a name="line427"></a>  var i = 0;
<a name="line428"></a>  var keys = this.keys_;
<a name="line429"></a>  var map = this.map_;
<a name="line430"></a>  var version = this.version_;
<a name="line431"></a>  var selfObj = this;
<a name="line432"></a>
<a name="line433"></a>  var newIter = new goog.iter.Iterator;
<a name="line434"></a>  newIter.next = function() {
<a name="line435"></a>    while (true) {
<a name="line436"></a>      if (version != selfObj.version_) {
<a name="line437"></a>        throw Error(&#39;The map has changed since the iterator was created&#39;);
<a name="line438"></a>      }
<a name="line439"></a>      if (i &gt;= keys.length) {
<a name="line440"></a>        throw goog.iter.StopIteration;
<a name="line441"></a>      }
<a name="line442"></a>      var key = keys[i++];
<a name="line443"></a>      return opt_keys ? key : map[key];
<a name="line444"></a>    }
<a name="line445"></a>  };
<a name="line446"></a>  return newIter;
<a name="line447"></a>};
<a name="line448"></a>
<a name="line449"></a>
<a name="line450"></a>/**
<a name="line451"></a> * Safe way to test for hasOwnProperty.  It even allows testing for
<a name="line452"></a> * &#39;hasOwnProperty&#39;.
<a name="line453"></a> * @param {Object} obj The object to test for presence of the given key.
<a name="line454"></a> * @param {*} key The key to check for.
<a name="line455"></a> * @return {boolean} Whether the object has the key.
<a name="line456"></a> * @private
<a name="line457"></a> */
<a name="line458"></a>goog.structs.Map.hasKey_ = function(obj, key) {
<a name="line459"></a>  return Object.prototype.hasOwnProperty.call(obj, key);
<a name="line460"></a>};
</pre>


</body>
</html>
